<template>
  <div class="interview-detail-container">
    <!-- 顶部 -->
    <van-nav-bar>
      <template #left>
        <i class="iconfont iconbtn_nav_back" @click="$router.go(-1)"></i>
      </template>
    </van-nav-bar>
    <!-- 主体内容区域 -->
    <div class="main-box">
      <!-- 标题区域 -->
      <div class="title-box">
        <div class="content">
          <div class="title van-multi-ellipsis--l2">
            {{ detail.title }}
          </div>
          <div class="info">
            <div class="time">{{ detail.created_at | formatTime }}</div>
            <div class="see">
              <i class="iconfont iconicon_liulanliang"></i>
              <span>{{ detail.read }}</span>
            </div>
            <div class="zan">
              <i class="iconfont iconbtn_dianzan_small_nor"></i>
              <span>{{ detail.star }}</span>
            </div>
          </div>
        </div>
      </div>
      <!-- 内容区域 -->
      <div class="main" v-html="detail.content"></div>
    </div>
  </div>
</template>

<script>
import { articlesTechnicDetail } from '../../api/api'
export default {
  name: 'article-detail',
  data () {
    return {
      detail: {}
    }
  },
  async created () {
    const id = this.$route.params.id
    const detailRes = await articlesTechnicDetail(id)
    // console.log(detailRes.data)
    this.detail = detailRes.data
  }
}
</script>

<style lang="less">
.interview-detail-container {
  .van-nav-bar__left {
    padding-left: 0;
  }
  .iconbtn_nav_back {
    font-size: 44px;
  }
  .main-box {
    padding: 15px;
    .main {
      padding-top: 28px;
      font-size: 16px;
      img {
        width: 100%;
      }
    }
  }
  .title-box {
    .content {
      flex: 1;
      display: flex;
      flex-direction: column;
      justify-content: space-between;
      .title {
        font-size: 16px;
        font-weight: 500;
        color: @fontColor;
      }
      .info {
        color: @minorFontColor;
        font-size: 12px;
        display: flex;
        margin-top: 10px;
        align-items: center;
        .time {
          flex: 1;
        }
        .iconfont {
          margin-right: 8px;
          font-size: 16px;
          line-height: 1;
        }
        .see {
          margin-right: 23px;
          display: flex;
          align-items: center;
        }
        .zan {
          display: flex;
          align-items: center;
        }
      }
    }
  }
}
</style>
